
//
//  DetailSecondTableViewCell.m
//  B
//
//  Created by Sunpeng on 15/11/6.
//  Copyright © 2015年 wangzhan. All rights reserved.
//

#import "DetailSecondTableViewCell.h"

@implementation DetailSecondTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createData];
    }
    return self;
    
    
}
-(void)createData{
    self.firstLabel = [[UILabel alloc]initWithFrame:CGRectMake(10*XWIDTH, 10*XHIGHT, 100*XWIDTH, 30*XHIGHT)];
    //self.firstLabel.backgroundColor = [UIColor blueColor];
    [self addSubview:self.firstLabel];
//    self.nameLabel.textAlignment = NSTextAlignmentCenter;
    
    self.secondlbel = [[UILabel alloc]initWithFrame:CGRectMake(10*XWIDTH, 45*XHIGHT, 340*XWIDTH, 60*XHIGHT)];
    //self.secondlbel.backgroundColor = [UIColor purpleColor];
    self.secondlbel.numberOfLines = 0;
    [self addSubview:self.secondlbel];
  
    self.thirdLabel = [[UILabel alloc]initWithFrame:CGRectMake(10*XWIDTH, 45*XHIGHT, 340*XWIDTH, 120*XHIGHT)];
    //self.secondlbel.backgroundColor = [UIColor purpleColor];
    self.thirdLabel.numberOfLines = 0;
    self.thirdLabel.lineBreakMode= NSLineBreakByWordWrapping ;
    [self addSubview:self.thirdLabel];
    
   
    



}
+(CGFloat)heightForCell:(NSString *)message{
    //设置宽度
    CGSize size = CGSizeMake(300*XWIDTH, 100000*XHIGHT);
    //设置字体  字体大小存到字典
    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:15], NSFontAttributeName,nil];
    CGRect rect= [message boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    return rect.size.height;
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
